package api

import (
	"errors"
	"github.com/gin-gonic/gin"
	"learn/consts"
	util "learn/pkg/utils/log"

	"learn/forms"
)

func ListProducts(ctx *gin.Context) {
	productForm := forms.ProductForm{}
	if err := ctx.ShouldBind(&productForm); err == nil {
		newError := errors.New("product")
		util.LogrusObj.Infoln(newError)
		ctx.JSON(consts.IlleageRequest, ErrorResponse(newError))
	} else {
		util.LogrusObj.Infoln(err)
		ctx.JSON(consts.IlleageRequest, ErrorResponse(err))
	}
}
